<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title>Convocatoria Tierras</title>
        <?php echo $this->Html->charset(); ?>
        <?php echo $html->css('humanity/jquery-ui-1.8.16.custom'); ?>
        <?php echo $html->css('all'); ?>
        <?php echo $html->css('datagrid_table'); ?>
        <?php echo $this->Html->css('elrte.min'); ?>
        <?php echo $javascript->link('jquery-1.7.1.min'); ?>
        <?php echo $javascript->link('jquery-ui-1.8.9.custom.min'); ?>
        <?php echo $javascript->link('jquery.ui.datepicker-es'); ?>
        <?php echo $javascript->link('jquery.dataTables'); ?>
        <?php echo $javascript->link('modal.popup'); ?>
        <?php echo $javascript->link('jquery.form'); ?>
        <?php echo $javascript->link('jquery.validate'); ?>
        <?php echo $javascript->link('jquery.cookie'); ?>
        <?php echo $javascript->link('messages_es'); ?>
        <?php echo $this->Javascript->link('elrte.min'); ?>
        <?php echo $this->Javascript->link('elrte.es'); ?>
        <script>     
            $(document).ready(function() {
                
                if($.cookie('tab_id')!=null) {
                    
                    if($('#'+$.cookie('tab_id')!="")){
                        $('#'+$.cookie('tab_id') ).addClass("active");
                        var tab_id=$.cookie('tab_id').replace("tab_", "");
                        $('#menu').load('<?php echo $html->url(array('controller' => 'menus', 'action' => 'ver')) ?>/'+tab_id);
                    }    
                }
                $("#top-navigation li").click(function() {
                    $("#top-navigation li").removeClass("active"); //Remove any "active" class
                    $(this).addClass("active"); //Add "active" class to selected tab
                    $.cookie('tab_id',$(this).attr('id'));
                });
            }
        );
            function cargar(){
                $('.tabla').dataTable( {
                    "sPaginationType": "full_numbers",
                    "iDisplayLength":100
                })
                $('.tb').dataTable( {
                    "sPaginationType": "full_numbers",
                    "iDisplayLength":50
                })
                $("input[type='submit']").click(function(){
                    if($(this).attr('class')!='not_hidden'){
                        $(this).hide();
                    }
                });
                mayusculas();
            }
            function mayusculas(){
                $("input,textarea").keyup(function(){
                    if($(this).attr('id')!='usr'){
                        $(this).val($(this).val().toUpperCase());
                    }
                });
            }
        </script>
    </head>
    <body>
        <div id="main">
            <div id="logo">
                <?php echo $html->image('logo_incoder.png', array('alt' => __("INCODER COLOMBIA", true), 'width' => '140', 'heigth' => '130', 'border' => "0", 'id' => "imglogo")) ?>
                <div id="right-header">
                    <table>
                        <tr>
                            <td><strong class="h">USUARIO</strong>
                                <div id="user">  <?php echo $usr . "<br>"; ?>      DEPENDENCIA: <?php echo $regional ?> </div>
                            </td> 
                            <td>
                                <?php echo $html->link($html->image('salir.png', array('width' => '50', 'heigth' => '50', 'id' => 'salir', 'alt' => __("SALIDA SEGURA", true), 'border' => "0")), array('controller' => 'users', 'action' => 'logout'), array('escape' => false)); ?>
                            </td>
                            <td>
                                <?php echo $html->image('escudo.png', array('alt' => __("INCODER COLOMBIA", true), 'width' => '130', 'heigth' => '130', 'border' => "0", 'id' => "imgescudo")) ?>
                            </td>
                        </tr>
                    </table>
                </div>        
            </div>
            <div id="header">
                <?php echo $this->element('tabs', array('lista' => $lista)) ?>
            </div>
            <div id="middle">
                <div id="menu">
                </div>
                <div id="center-column">
                    <div class="top-bar" id="current">
                        <?php
                        $ajax->remoteTimer(
                                array(
                                    'url' => array('controller' => 'proyects', 'action' => 'checksesion'),
                                    'update' => 'current',
                                    'frequency' => 600
                                )
                        );
                        ?>
                        <?php
                        if ($this->Session->read('cod') == "") {
                            echo"<h2 align='center' style='color: #FF7A00'  >  NO HA SELECCIONADO PROYECTO </h2>";
                        } else {
                            echo"<h2 align='center' style='color: #FF7A00'  >   PROYECTO ACTIVO:" . $this->Session->read('call_nombre') . " " . strtoupper($this->Session->read('cod')) . "</h2>";
                        }
                        ?> 
                    </div><br />
                    <div class="select-bar">
                        <?php
                        echo $form->create('Proyect');
                        ?>
                        <table  cellpadding="0" >
                            <tr>
                                <td width="100px" height= "20px" >

                                    <?php echo $form->input("Proyect.call_id", array('label' => 'Convocatoria')); ?>
                                </td>
                            </tr>
                            <tr >
                                <td width="100px" height= "20px" >
                                    <input type="text" name="proyecto" id="usr"   />
                                </td>
                                <td height= "20px" width="50px" align="left" id="divx">
                                    <?php echo $ajax->submit('Seleccionar Proyecto', array('url' => array('controller' => 'Proyects', 'action' => 'select_proyect'), 'update' => 'current', 'indicator' => 'loading', 'class' => 'not_hidden', 'complete' => '$("#content").html("");')); ?>
                                </td>
                            </tr>
                        </table>
                        <?php echo $form->end(); ?>
                    </div>
                    <div id="loading" style="display: none;">
                        <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
                    </div>
                    <div id="content" class="content">
                        <?php echo $this->Session->flash(); ?>
                        <?php echo $content_for_layout; ?>
                    </div>
                </div>
            </div>
            <div id="footer"><p>INCODER - Todos los derechos reservados 2014
                    Linea Atención al Ciudadano: 018000 110132 - PBX: 383 0444 Ext. 1124 - eMail: buzonciudadano@incoder.gov.co<br />
                    Av. El Dorado CAN, Calle 43 #57-41, Lunes a Viernes 8.00 a.m. a 5:00 p.m. - República de Colombia.</p></div>
        </div>
    </body>
</html>